home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 2.5 KB | 88 lines | [TEXT/MPS ] |
- =TYPE,redef
-
- { type redefs for MacApp 3.3 Final for use with ••• MPW or Metrowerks ••• }
-
-
- CstringPtr = ^Cstring;
- pClassDesc = ^ClassDesc;
- hClassDesc = ^pClassDesc;
- ProcHandle = ^ProcPtr;
- pLongInt = ^LongInt;
- pinteger = ^integer;
-
- ClassDesc = Record { MA 3.3 Final }
- { 0} fDefaultConstructo : ProcHandle;
- { 4} fNextClassDesc : pClassDesc;
- { 8} fClassName : CstringPtr;
- { 12} fClassSize : HLongInt;
- { 16} fClassID : INTEGER;
- { 18} fAncestors : hClassDesc;
- { 22} fAncestorOffsets : pLongInt;
- end;
-
- { p__mptr = ^__mptr; ignore this as Metrowerks is different }
- pCArrayIterator = ^CArrayIterator;
-
- { NOTE the use of 'Handle | ARRAY[1..fSize] of Tobject' }
- { to redefine list types in MacApp 3.3 Final }
-
- { YOU can generalize this trick to Similar types such as : }
- { TDynamicArray, TSortedDynamicArray, TCmdTable, TMenuIDList, }
- { TSortedHandleList, THandleList, TEventList , ... }
-
- TList = Record { MacApp 3.3 Final }
- fClassID : Word;
- __vptr : HLongint; { in MPW: p__mptr }
- fIteratorPtr : pCArrayIterator;
- filler1:integer;
- fSize : integer; { Dbgr can't handle long Upper bnds }
- fElementSize : INTEGER;
- fElementSizeShift : INTEGER;
- fAllocIncr : LongInt;
- fAllocatedSize : LongInt;
- fFreeRequested : Byte;
- fArraySpace : Handle | ARRAY[1..fSize] of Tobject;
- fEltClassDesc : pClassDesc;
- END;
-
- { put other type redefs here }
- =t,redef
- TEntriesList = TList;
- TEventList = TList;
-
- =- commented out section
-
- Target Chain Menu Item by Steve Sissak
-
- =AddMenu
- 'Target Chain/4'
- ?ReDirect('Target Chain');
- ?n := gExtDbgr_Info.n_classes; { use this as an error check }
- ?le := (gExtDbgr_Info.pOrderedClass)^; { ptr to array }
- ?targ := TApplication(gApplication^).fTarget;
- writeln('Current Task = ',CurApName:String);
- writeln;
- WHILE ?targ <> 0 DO BEGIN
- ?beh := TEventHandler(?targ).fBehavior;
- WHILE ?beh <> 0 DO BEGIN
- ?id := TObject(?beh).fClassID - 1; { the class ID }
- if ?id <= ?n then begin
- write(' ');
- write( ClassDesc((?le+4*?id)^).fClassName^:CString:-1);
- write('_@',?beh:HLongint:8);
- writeln;
- end;
- ?beh := TBehavior(?beh).fNextBehavior; { next on chain }
- END;
- ?id := TObject(?targ).fClassID - 1; { the class ID }
- if ?id <= ?n then begin
- write( ClassDesc((?le+4*?id)^).fClassName^:CString:-1);
- write('_@',?targ:HLongint:8);
- writeln;
- end;
- ?targ := TEventHandler(?targ).fNextHandler; { next on chain }
- END;
- ?ReDirect;
-
- =- end of scripting example
-